import java.util.Scanner;

/**
 * @author gao
 * @date 2025/8/27 15:46
 */

public class Solution {
    public int hammingDistance(int x, int y) {
        // 异或操作
        int or = x ^ y, distance = 0;

        while (or != 0) {
            distance += 1;
            // Brian Kernighan算法，清除最低位的1
            or = or & (or - 1);
        }
        return distance;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            int x = in.nextInt();
            int y = in.nextInt();
            Solution solution = new Solution();
            System.out.println(solution.hammingDistance(x, y));
        }
    }
}